#ifndef DW_INPUTS_MANAGER_H
#	define DW_INPUTS_MANAGER_H

#include "base/singleton.h"

#include "system/window.h"

#include <OIS/OISInputManager.h>
#include <OIS/OISException.h>
#include <OIS/OISKeyboard.h>
#include <OIS/OISMouse.h>
#include <OIS/OISEvents.h>

namespace dw {
	namespace inputs {

class InputCommand;

class InputManager
:	public OIS::KeyListener
,	public OIS::MouseListener
,	public dw::base::Singleton< InputManager, false >
{
public : //! @name Types definitions
	//! @{
	typedef std::vector< InputCommand* > CommandsCollection;
	//! @}

public : //! @name Commands
	//! @{
	void initialize(const dw::system::Window& window);
	void update();

	void registerCommand(InputCommand* command);
	void unregisterCommand(InputCommand* command);
	//! @}

public : //! @name OIS::KeyListener interface
	//! @{
	bool keyPressed(const OIS::KeyEvent &arg);
	bool keyReleased(const OIS::KeyEvent &arg);
	//! @}

public : //! @name OIS::MouseListener interface
	//! @{
	bool mouseMoved(const OIS::MouseEvent &arg);
	bool mousePressed(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
	bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id);
	//! @}

protected : //! @name Construction & destruction
	//! @{
	InputManager();
	~InputManager();
	//! @}

private : //! @name Data
	//! @{
	friend class dw::base::Singleton< InputManager, false >;
	
	CommandsCollection m_commands;

	OIS::InputManager* m_inputManager;
	OIS::Keyboard* m_keyboard;
	OIS::Mouse* m_mouse;
	//! @}
};

	} // namespace inputs
} // namespace dw

#endif // !DW_INPUTS_MANAGER_H
